function transition_sequence = transitionSeq(originalSeq)

transition_sequence = zeros(size(originalSeq));
for i=1:length(originalSeq)
    if i==1
        if (originalSeq(1)<=0) || (originalSeq(end)<=0)
            transition_sequence(i) = -1;
        else
            transition_sequence(i) = abs(originalSeq(1)-originalSeq(end));
        end
    else
        if (originalSeq(i)<=0) || (originalSeq(i-1)<=0)
            transition_sequence(i) = -1;
        else
            transition_sequence(i) = abs(originalSeq(i)-originalSeq(i-1));
        end
    end
end